/**
* 版权归 瞄你个汪 所有。
* 使用本代码应遵守相关法律法规和许可证的要求。
*/
package cn.sqlsuper.entity;

import cn.sqlsuper.annotation.SuperColumn;
import cn.sqlsuper.annotation.SuperIndex;
import cn.sqlsuper.annotation.SuperTable;
import cn.sqlsuper.entity.base.EntityBase;
import cn.sqlsuper.eunm.SysMenuTypeEnum;
import cn.sqlsuper.eunm.SysStatusEnum;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName;
import lombok.Data;
import lombok.EqualsAndHashCode;

import java.io.Serializable;
import java.util.List;

/**
 * <p>
 * 系统菜单表
 * </p>
 * @author 瞄你个汪
 * @since 2024-05-01 12:00:00
 */
@Data
@EqualsAndHashCode(callSuper = true)
@TableName(value = "sys_menu")
@SuperTable(value = "系统菜单表", isSystem = true, indexes = {
        @SuperIndex(indexName ="sys_index_{table}_T", indexFields ="title"),
        @SuperIndex(indexName ="sys_index_{table}_T2", indexFields ="type"),
})
public class SysMenu extends EntityBase implements Serializable {
    private static final long serialVersionUID = 1L;

    @SuperColumn(value = "父ID")
    private Long pId;

    @SuperColumn(value = "菜单类型")
    private SysMenuTypeEnum type;

    @SuperColumn(value = "菜单名称", length = 64)
    private String title;

    @SuperColumn(value = "图标", length = 128, nullable = true)
    private String icon;

    @SuperColumn(value = "路由名称", length = 64, nullable = true)
    private String Name;

    @SuperColumn(value = "路由路径", length = 128, nullable = true)
    private String Path;

    @SuperColumn(value = "组件路径", length = 128, nullable = true)
    private String component;

    @SuperColumn(value = "重定向", length = 128, nullable = true)
    private String redirect;

    @SuperColumn(value = "权限标识", length = 128, nullable = true)
    private String permission;

    @SuperColumn(value = "是否内嵌")
    private boolean IsIframe;

    @SuperColumn(value = "外链链接", nullable = true)
    private String outLink;

    @SuperColumn(value = "是否隐藏")
    private boolean isHide;

    @SuperColumn(value = "是否缓存")
    private boolean isKeepAlive = true;

    @SuperColumn(value = "是否固定")
    private boolean isAffix;

    @SuperColumn(value = "状态")
    private SysStatusEnum status = SysStatusEnum.Enabled;

    @SuperColumn(value = "排序", defaultValue = "100")
    private Integer orderNo = 100;

    @SuperColumn(value = "备注", nullable = true, length = 128)
    private String remark;

    @TableField(exist = false)
    private List<SysMenu> children;
}
